package cn.szzsi._admin;


import cn.szzsi.common.kit.CommonUtil;
import cn.szzsi.common.model.CustomerAllowance;
import cn.szzsi.service.AllowanceService;

import java.util.Map;

/**
 * 辅导津贴
 * Created by zhengy on 2017/2/21.
 */
public class AllowanceController extends BaseAdminController<CustomerAllowance> {
    private String shopId;
    public void list(){
        render(CommonUtil.TEMPLATE_PATH+"/business/fdjt/index.html");
    }
    public void ajaxlist(){
        shopId=getAttr("shopId");
        Integer memberLevel=getParaToInt("type",1);//几级分红(默认1级分红)
        Map<String,Object> result = AllowanceService.ds.getFdjtList(memberLevel,shopId);
        renderJson(result);
    }
    /*public void exportfdjt(){
        Integer dataLevel=getParaToInt("dataLevel");
        List<Record> list = Db.find("select m.code,m.username,m.phone,b.rewardnum,b.profit,(case when b.status=1 then '已分配' else '未分配' end)status,b.createDate  from mall_member m right join b_customer_allowance b on m.id=b.mid where b.memberLevel=?  and b.uid=?",dataLevel,getUid());
        String[] header={"会员ID","会员昵称","联系方式","总收入","分红金额","分红状态","日期"};
        String[] columns={"code","username","phone","totalIncome","profit","status","createDate"};
        Render poirender = PoiRender.me(list).fileName("fdjt.xls").headers(header).sheetName("辅导津贴").columns(columns);
        render(poirender);
    }*/
}
